﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DataBaseLibrary.DBObjectsFB;

namespace DocMreoLiteVersion.Controls
{
    /// <summary>
    /// Interaction logic for ProxyInfoControl.xaml
    /// </summary>
    public partial class ProxyInfoControl : UserControl
    {

        public static readonly DependencyProperty HeaderWindowProperty =
    DependencyProperty.Register("HeaderWindow", typeof(String), typeof(ProxyInfoControl));

        public String HeaderWindow
        {
            set { DataContext = value; SetValue(HeaderWindowProperty, value); }
            get { return (String)GetValue(HeaderWindowProperty); }
        }


        /// <summary>
        /// Объект информации о представителе
        /// </summary>
        private Representative mRepresentativeObject;

        public Representative RepresentativeObject
        {
            set
            {
                DataContext = value;
                mRepresentativeObject = value;
            }
            get { return mRepresentativeObject; }
        }


        
        public ProxyInfoControl()
        {
            InitializeComponent();
        }

        
        private void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                const FocusNavigationDirection focusNav = FocusNavigationDirection.Next;
                var request = new TraversalRequest(focusNav);


                if ((sender as UIElement) != null)
                    (sender as UIElement).MoveFocus(request);



                e.Handled = true;
            }

        }
    }
}
